package com.kjtpay.design_pattern.state;

class SleepingState extends State {
    // 21~24~9 晚上9点之后，第二天9点之前为睡眠时间
    @Override
    public void writeProgram(Work work) {
        if ((work.hour >= 21) || (work.hour < 9)) {
            information = "当前时间：" + work.hour + "点" + work.hour + "分"
                    + " ===> 不行了，睡着了";
        } else {
            work.current = new ForenoonState();
            work.writeProgram();
        }
    }
}
